package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.SetmealService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("setmeal")
public class SetmealMobileController {

    @Reference
    private SetmealService setmealService;

    //查询所有套餐
    @RequestMapping("/findSetmealAll")
    public void findSetmealAll(HttpServletResponse response) throws IOException {
        response.getWriter().write(setmealService.findSetmealAll());
    }

    //查询一个具体套餐
    @RequestMapping("/findById")
    public void findById(HttpServletResponse response,String id) throws IOException {
        response.getWriter().write(setmealService.findById(id));
    }

}
